package nl.unimaas.micc.umsnooker.gameflow.phases;

import java.util.HashSet;

import nl.unimaas.micc.umsnooker.domain.BilliardBall;
import nl.unimaas.micc.umsnooker.gameflow.GamePhase;
import nl.unimaas.micc.umsnooker.gameflow.GameState;
import nl.unimaas.micc.umsnooker.simulation.event.CueInteraction;
import nl.unimaas.micc.umsnooker.simulation.event.NoisyCueInteraction;

public class AimingPhase extends GamePhase
{
	private float angDest, angElev, transX, transY, velocity;

	public AimingPhase(GameState state)
	{
		super(state);
		angDest = 0;
		angElev = 0;
		transX = 0;
		transY = 0;
		velocity = 0;
	}
	
	public void setTransX(float transX)
	{
		this.transX = transX;
	}

	public void setTransY(float transY)
	{
		this.transY = transY;
	}

	public void setAngDest(float angDest)
	{
		this.angDest = angDest;
	}

	public void setAngElev(float angElev)
	{
		this.angElev = angElev;
	}

	public void setVelocity(float velocity)
	{
		this.velocity = velocity;
	}

	@Override
	public void finish()
	{
		if (finished)
		{
			return;
		}
		CueInteraction event = new NoisyCueInteraction(0, state.getCueBall(), angDest, angElev, transX, transY, velocity);

		setNext(new SimulationPhase(state, event));
		super.finish();
	}
}